package com.windward.vii.web.controller;

import com.windward.vii.common.JsonResult;
import com.windward.vii.common.ResultCode;
import com.windward.vii.domain.goods.GoodsVO;
import com.windward.vii.service.GoodsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by tiansj on 2017/8/26.
 */
@Controller
public class GoodsController {

    @Resource
    GoodsService goodsService;

    @RequestMapping(value = "v1/api1/goods/list", method = RequestMethod.GET)
    @ResponseBody
    public JsonResult getGoodsList(@RequestParam Integer terminalType) {
        List<GoodsVO> list = goodsService.getGoodsList(terminalType);
        return new JsonResult(ResultCode.SUCCESS_CODE, ResultCode.SUCCESS_MSG, list);
    }

}
